package com.woniu.userservice.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
/**
 * @Auther: 李浪  <br/>
 * @Date: 2020/3/19:0:53  <br/>
 * @Description:文件上传
 */
@Configuration
public class FileUpload {
	 @Bean
		public MultipartResolver multipartResolver() {
			 CommonsMultipartResolver resolver=new CommonsMultipartResolver();
			 resolver.setDefaultEncoding("UTF-8");//设置编码
			 resolver.setMaxUploadSize(1000*1024);//设置上传大小限制
			 return resolver;
		}
}
